﻿using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;

namespace ASPNETVN.PORTAL.Modules.INTRODUCTION.Components
{
    public partial class Item
    {
        public static DataSet GetTopItems(Guid moduleID)
        {
            const string spName = "[dbo].[p_INTRODUCTION_Item_GetTopItems]";
            SqlDatabase db = DatabaseFactory.CreateDatabase() as SqlDatabase;
            SqlCommand dbCommand = db.GetStoredProcCommand(spName) as SqlCommand;
            db.AddInParameter(dbCommand, "@ModuleID", SqlDbType.UniqueIdentifier, moduleID);

            return db.ExecuteDataSet(dbCommand);
        }
    }
}
